package com.woniuxy.common.mapper;

import com.woniuxy.common.entity.MarketAttention;
import com.woniuxy.common.entity.MarketAttentionExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MarketAttentionMapper {
    long countByExample(MarketAttentionExample example);

    int deleteByExample(MarketAttentionExample example);

    int deleteByPrimaryKey(String id);

    int insert(MarketAttention record);

    int insertSelective(MarketAttention record);

    List<MarketAttention> selectByExample(MarketAttentionExample example);

    MarketAttention selectByPrimaryKey(String id);

    int updateByExampleSelective(@Param("record") MarketAttention record, @Param("example") MarketAttentionExample example);

    int updateByExample(@Param("record") MarketAttention record, @Param("example") MarketAttentionExample example);

    int updateByPrimaryKeySelective(MarketAttention record);

    int updateByPrimaryKey(MarketAttention record);

    @Select("select * from market_attention where user_id=#{userid} order By date DESC")
    List<MarketAttention> findAllAtentionByUserId(String userid);

    @Select("select * from market_attention where receiveuser_id=#{receiveUserid} order By date DESC")
    List<MarketAttention> findAllFansByReceiveUserId(String receiveUserid);

    @Select("select * from market_attention where user_id=#{loginuserid} and receiveuser_id=#{userid}")
    MarketAttention selectAttentionStatus(@Param("userid") String userid,@Param("loginuserid") String loginuserid);
}